package com.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.entity.Record;
import com.entity.Student;
import com.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zgg
 * @since 2021-08-24
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService iss;
    @GetMapping("/{pageNum}/{pageSize}")
    public IPage<Student> showPageStudent(@PathVariable("pageNum") Integer pageNum,
                                        @PathVariable("pageSize") Integer pageSize){
        Page<Student> page = new Page<>(pageNum,pageSize);
        IPage<Student> iPage = iss.page(page, null);
        return iPage;
    }
    @GetMapping("/selectAll")
    public List<Student> selectAll(){
        return iss.list();
    }

}

